package com.shd.edanpei.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.shd.edanpei.common.Constant;
import com.shd.edanpei.enums.GenderEnum;

/**
 * Created by mc on 2018/9/22.
 * yang-wen-wen
 */

public class CustomerBean implements Parcelable {

    private String area;
    private String name;//姓名
    private String sex;//性别
    private String birthday;//生日
    private String idCardNo;//身份证号
    private String mobile;//联系方式
    private String bankCardNo;//银行卡号
    private boolean isMarrage;//婚姻状况
    private String spouseName;//配偶姓名
    private String spouseMobile;//配偶联系方式
    private String income;//当前收入
    private String industry;//行业
    private String address;//常住地址
    private String detailAddress;//详细地址

    private String customerId;//客户ID
    private String orderId;//订单ID

    private String roomSize;//住房面积
    private String roomType;//住房性质
    private String roomAge;//房龄
    private String roomStatus;//住房现状
    private String roomArea;//住房所在地
    private String houseDetailAddress;//详细地址
    private String cityCode;//城市标码
    private String gcityCode;//城市国际标码
    private String applyAmount;//订单金额
    private String applyInterest;//预期比
    private String applyRepaymentType;//归还方式
    private String applyTerm;//订单期限
    private boolean haveOtherHouse;//其他固定资产
    private boolean haveCompany;//名下公司
    private String companyShare;//占股比例
    private String operationState;//经营状况
    private String operationTerm;//经营年限
    //    private String liabilitiesStatus;//负债情况
//    private boolean haveField;//名下场地
//    private String fieldArea;//场地面积
    private String remark;//备注说明
    private String carNo;
    private String drivingDistance;
    private String carAge;
    private String carStatus;
    private boolean haveCarInsurance;
    private String insuranceTerm;
    private String areaCode;

    private  String isCreditHouse="0";//住房信用贷
    private  String isCreditInsurance="0";//保单信用贷
    private  String isCreditFund="0";//公积金信用贷
    private  String companyName=null;//企业名称
    private  String holdRatio=null;//个人持股比


    //2019年4月新添加个人信用贷

    public CustomerBean() {

    }


    protected CustomerBean(Parcel in) {
        area = in.readString();
        name = in.readString();
        sex = in.readString();
        birthday = in.readString();
        idCardNo = in.readString();
        mobile = in.readString();
        bankCardNo = in.readString();
        isMarrage = in.readByte() != 0;
        spouseName = in.readString();
        spouseMobile = in.readString();
        income = in.readString();
        industry = in.readString();
        address = in.readString();
        detailAddress = in.readString();
        customerId = in.readString();
        orderId = in.readString();
        roomSize = in.readString();
        roomType = in.readString();
        roomAge = in.readString();
        roomStatus = in.readString();
        roomArea = in.readString();
        houseDetailAddress = in.readString();
        cityCode = in.readString();
        gcityCode = in.readString();
        areaCode = in.readString();
        applyAmount = in.readString();
        applyInterest = in.readString();
        applyRepaymentType = in.readString();
        applyTerm = in.readString();
        haveOtherHouse = in.readByte() != 0;
        haveCompany = in.readByte() != 0;
        companyShare = in.readString();
        operationState = in.readString();
        operationTerm = in.readString();
//        liabilitiesStatus = in.readString();
//        haveField = in.readByte() != 0;
//        fieldArea = in.readString();
        remark = in.readString();
        carNo = in.readString();
        drivingDistance = in.readString();
        carAge = in.readString();
        carStatus = in.readString();
        haveCarInsurance = in.readByte() != 0;
        insuranceTerm = in.readString();
        isCreditHouse=in.readString();
        isCreditInsurance=in.readString();
        isCreditFund=in.readString();
        companyName=in.readString();
        holdRatio=in.readString();

    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(area);
        dest.writeString(name);
        dest.writeString(sex);
        dest.writeString(birthday);
        dest.writeString(idCardNo);
        dest.writeString(mobile);
        dest.writeString(bankCardNo);
        dest.writeByte((byte) (isMarrage ? 1 : 0));
        dest.writeString(spouseName);
        dest.writeString(spouseMobile);
        dest.writeString(income);
        dest.writeString(industry);
        dest.writeString(address);
        dest.writeString(detailAddress);
        dest.writeString(customerId);
        dest.writeString(orderId);
        dest.writeString(roomSize);
        dest.writeString(roomType);
        dest.writeString(roomAge);
        dest.writeString(roomStatus);
        dest.writeString(roomArea);
        dest.writeString(houseDetailAddress);
        dest.writeString(cityCode);
        dest.writeString(gcityCode);
        dest.writeString(areaCode);
        dest.writeString(applyAmount);
        dest.writeString(applyInterest);
        dest.writeString(applyRepaymentType);
        dest.writeString(applyTerm);
        dest.writeByte((byte) (haveOtherHouse ? 1 : 0));
        dest.writeByte((byte) (haveCompany ? 1 : 0));
        dest.writeString(companyShare);
        dest.writeString(operationState);
        dest.writeString(operationTerm);
//        dest.writeString(liabilitiesStatus);
//        dest.writeByte((byte) (haveField ? 1 : 0));
//        dest.writeString(fieldArea);
        dest.writeString(remark);
        dest.writeString(carNo);
        dest.writeString(drivingDistance);
        dest.writeString(carAge);
        dest.writeString(carStatus);
        dest.writeByte((byte) (haveCarInsurance ? 1 : 0));
        dest.writeString(insuranceTerm);
        dest.writeString(isCreditHouse);
        dest.writeString(isCreditInsurance);
        dest.writeString(isCreditFund);
        dest.writeString(companyName);
        dest.writeString(holdRatio);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<CustomerBean> CREATOR = new Creator<CustomerBean>() {
        @Override
        public CustomerBean createFromParcel(Parcel in) {
            return new CustomerBean(in);
        }

        @Override
        public CustomerBean[] newArray(int size) {
            return new CustomerBean[size];
        }
    };

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public String getGender() {
        return sex.equals(GenderEnum.male.getKey() + "") ? "男" : "女";
    }


    public void setSex(String sex) {
//        this.sex = sex.equals(GenderEnum.male.getValue()) ? String.valueOf(GenderEnum.male.getKey()) : String.valueOf(GenderEnum.female.getKey());
        this.sex = sex;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getIdCardNo() {
        return idCardNo;
    }

    public void setIdCardNo(String idCardNo) {
        this.idCardNo = idCardNo;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

//    public String getBankCardNo() {
//        return bankCardNo;
//    }

    public void setBankCardNo(String bankCardNo) {
        this.bankCardNo = bankCardNo;
    }

    public boolean isMarrage() {
        return isMarrage;
    }

    public void setMarrage(boolean marrage) {
        isMarrage = marrage;
    }

    public String getSpouseName() {
        return spouseName;
    }

    public void setSpouseName(String spouseName) {
        this.spouseName = spouseName;
    }

    public String getSpouseMobile() {
        return spouseMobile;
    }

    public void setSpouseMobile(String spouseMobile) {
        this.spouseMobile = spouseMobile;
    }

    public String getIncome() {
        return income;
    }

    public void setIncome(String income) {
        this.income = income;
    }

    public String getIndustry() {
        return industry;
    }

    public void setIndustry(String industry) {
        this.industry = industry;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDetailAddress() {
        return detailAddress;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }

    public String getCustomerId() {
        return customerId;
    }

    public void setCustomerId(String customerId) {
        this.customerId = customerId;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getRoomSize() {
        return roomSize;
    }

    public void setRoomSize(String roomSize) {
        this.roomSize = roomSize;
    }

    public String getRoomType() {
        return roomType;
    }

    public void setRoomType(String roomType) {
        this.roomType = roomType;
    }

    public String getRoomAge() {
        return roomAge;
    }

    public void setRoomAge(String roomAge) {
        this.roomAge = roomAge;
    }

    public String getRoomStatus() {
        return roomStatus;
    }

    public void setRoomStatus(String roomStatus) {
        this.roomStatus = roomStatus;
    }

    public String getRoomArea() {
        return roomArea;
    }

    public String getHouseDetailAddress() {
        return houseDetailAddress;
    }

    public void setHouseDetailAddress(String houseDetailAddress) {
        this.houseDetailAddress = houseDetailAddress;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getGcityCode() {
        return gcityCode;
    }

    public void setGcityCode(String gcityCode) {
        this.gcityCode = gcityCode;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getApplyAmount() {
        return applyAmount != null ? applyAmount + Constant.Unit.WANYUAN.getUnit() : "";
    }

    public void setApplyAmount(int applyAmount) {
        this.applyAmount = String.valueOf(applyAmount);
    }

    public String getApplyInterest() {
        return applyInterest;
    }

    public void setApplyInterest(String applyInterest) {
        this.applyInterest = applyInterest;
    }

    public String getApplyRepaymentType() {
        return applyRepaymentType;
    }

    public void setApplyRepaymentType(String applyRepaymentType) {
        this.applyRepaymentType = applyRepaymentType;
    }

    public String getApplyTerm() {
        return applyTerm;
    }

    public void setApplyTerm(String applyTerm) {
        this.applyTerm = applyTerm;
    }

    public boolean isHaveOtherHouse() {
        return haveOtherHouse;
    }

    public void setHaveOtherHouse(boolean haveOtherHouse) {
        this.haveOtherHouse = haveOtherHouse;
    }

    public boolean isHaveCompany() {
        return haveCompany;
    }

    public void setHaveCompany(boolean haveCompany) {
        this.haveCompany = haveCompany;
    }

    public String getCompanyShare() {
        return companyShare;
    }

    public void setCompanyShare(String companyShare) {
        this.companyShare = companyShare;
    }

    public String getOperationState() {
        return operationState;
    }

    public void setOperationState(String operationState) {
        this.operationState = operationState;
    }

    public String getOperationTerm() {
        return operationTerm;
    }

    public void setOperationTerm(String operationTerm) {
        this.operationTerm = operationTerm;
    }

//    public String getLiabilitiesStatus() {
//        return liabilitiesStatus;
//    }
//
//    public void setLiabilitiesStatus(String liabilitiesStatus) {
//        this.liabilitiesStatus = liabilitiesStatus;
//    }
//
//    public boolean isHaveField() {
//        return haveField;
//    }
//
//    public void setHaveField(boolean haveField) {
//        this.haveField = haveField;
//    }
//
//    public String getFieldArea() {
//        return fieldArea;
//    }
//
//    public void setFieldArea(String fieldArea) {
//        this.fieldArea = fieldArea;
//    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCarNo() {
        return carNo;
    }

    public void setCarNo(String carNo) {
        this.carNo = carNo;
    }

    public String getDrivingDistance() {
        return drivingDistance == null ? "" : drivingDistance + Constant.Unit.WANKM.getUnit();
    }

    public void setDrivingDistance(String drivingDistance) {
        this.drivingDistance = drivingDistance;
    }

    public String getCarAge() {
        return carAge;
    }

    public void setCarAge(String carAge) {
        this.carAge = carAge;
    }

    public String getCarStatus() {
        return carStatus;
    }

    public void setCarStatus(String carStatus) {
        this.carStatus = carStatus;
    }

    public void setRoomArea(String roomArea) {
        this.roomArea = roomArea;
    }

    public void setApplyAmount(String applyAmount) {
        this.applyAmount = applyAmount;
    }

    public boolean isHaveCarInsurance() {
        return haveCarInsurance;
    }

    public void setHaveCarInsurance(boolean haveCarInsurance) {
        this.haveCarInsurance = haveCarInsurance;
    }

    public String getInsuranceTerm() {
        return insuranceTerm;
    }

    public void setInsuranceTerm(String insuranceTerm) {
        this.insuranceTerm = insuranceTerm;
    }


    public String getHouse() {
        return isCreditHouse;
    }

    public void setHouse(String house) {
        this.isCreditHouse = house;
    }

    public String getInsurance() {
        return isCreditInsurance;
    }

    public void setInsurance(String insurance) {
        this.isCreditInsurance = insurance;
    }

    public String getFund() {
        return isCreditFund;
    }

    public void setFund(String fund) {
        this.isCreditFund = fund;
    }
    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String fcompanyNameund) {
        this.companyName = fcompanyNameund;
    }

    public String getHoldRatio() {
        return holdRatio;
    }

    public void setHoldRatio(String holdRatio) {
        this.holdRatio = holdRatio;
    }
}
